﻿<div class="module-container">
    <div class="search-panel">
        <form class="form-inline search-table">
            <div class="form-group">
                <input class="form-control w200px" name="key" type="text"
                       placeholder="请输入查询关键字">
            </div>
            <div class="form-group">
                <select class="form-control uiselect uiselectsubmit" name="status"
                        data-has-text-field="false">
                    @Html.EmptyOption("全部状态")
                    <option value="0">未提交</option>
                    <option value="1">已提交</option>
                    <option value="2">审核通过</option>
                </select>
            </div>
            <div class="form-group">
                <select class="form-control uiselect uiselectsubmit" name="industry_category"
                        data-has-text-field="false" data-width="150px">
                    @Html.EmptyOption("全部行业类别")
                    <option value="道路货运">道路货运</option>
                    <option value="道路危货">道路危货</option>
                    <option value="道路客运">道路客运</option>

                    <option value="机动车维修">机动车维修</option>
                    <option value="驾驶员培训">驾驶员培训</option>

                    <option value="出租汽车">出租汽车</option>
                    <option value="其他">其他</option>
                </select>
            </div>

            <div class="form-group">
                <select class="form-control uiselect uiselectsubmit" name="user_category"
                        data-has-text-field="false" data-width="150px">
                    @Html.EmptyOption("全部报考类别")
                    <option value="企业主要负责人">企业主要负责人</option>
                    <option value="安全生产管理人">安全生产管理人</option>
                </select>
            </div>

            <div class="input-group date uidate">
                <input class="form-control" name="start_exam_date" type="text" placeholder="请选择考试开始日期" title="请选择考试开始日期">
                <span class="input-group-addon">
                    <i class="glyphicon glyphicon-th"></i>
                </span>
            </div>
            <div class="input-group date uidate">
                <input class="form-control" name="end_exam_date" type="text" placeholder="请选择考试结束日期" title="请选择考试结束日期">
                <span class="input-group-addon">
                    <i class="glyphicon glyphicon-th"></i>
                </span>
            </div>

            <button class="btn btn-primary" type="submit">
                <i class="fa fa-search"></i> 查询
            </button>

            <a class="btn btn-danger tmdelete" data-table=".uitable" data-url="@Url.Action("Delete")">
                <i class="fa fa-trash-o"></i> 删除
            </a>

            <a class="btn btn-default" id="table_export" data-url="@Url.Action("Export")">
                <i class="fa fa-share-square-o"></i> 导出
            </a>
        </form>
    </div>
    <div class="uitable" data-url="@Url.Action("Grid")">
        @Html.Action("Grid")
    </div>
</div>
<script>
    $('.uitable').on('click', '.updatePayStatus', function () {
        var url = '@Url.Action("UpdatePayStatus")';
        var id = $(this).data('id')
        fx.ajax({
            url: url,
            data: { id: id},
            confirm: '确定要将学员的支付状态改为线下支付吗?',
            success: function (result) {
                if (result.success) {
                    $('.search-table').find(':submit').click();
                }
                else if (result.message) {
                    fx.alert(result.message);
                }
            }
        });
    });


    $('.uitable').on('click', '.editExamDate', function () {
        var url = '@Url.Action("EditExamDate")';
        var id = $(this).data('id')
        fx.ajax({
            url: url,
            data: { id: id},
            confirm: '确定要修改学员的考试日期吗?',
            success: function (result) {
                debugger
                if (result.success) {
                    $('.search-table').find(':submit').click();
                }
                else if (result.message) {
                    fx.alert(result.message);
                }
            }
        });
    });


    $('#table_export').on('click', function () {
        var url = $(this).data('url') + '?' + $.param(fx.serializeForm($('.search-table')));
        window.location.href = url;
    });
</script>